package models;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import play.db.jpa.Model;

@Entity
public class Formation extends Model {
	
	public String libelleFormation;

	@OneToMany(mappedBy="formationStudent", cascade={CascadeType.MERGE, CascadeType.PERSIST} )
	public Set<Student> listStudentFormation;

	public Formation(String libelleFormation) {
		super();
		this.libelleFormation = libelleFormation;
		this.listStudentFormation = null;
	}

	@Override
	public String toString() {
		return libelleFormation;
	}	
}
